package com.one.common.common.system.model.response;

import com.one.common.model.http.base.BaseResponse;
import com.one.common.utils.StringUtils;

/**
 * Author: zhulunjun
 * Email: zhulunjun@qq.com
 * CreateDate: 2018/12/17 11:17
 * Description：版本更新
 **/
public class UpdateVersionResponse extends BaseResponse {

    private String system_version;
    /**
     * 下载地址
     */
    private String download_address;
    /**
     * 强制更新状态【1-是    2-否】'
     */
    private String is_forced;
    /**
     * 版本升级描述
     */
    private String description;
    private String version;
    /**
     * 0: 没有更新  1:有更新
     */
    private String is_update;
    /**
     * pgy返回的数据，用于设置蒲公英已更新完成
     */
    private String pgyResult;

    public String getPgyResult() {
        return pgyResult;
    }

    public void setPgyResult(String pgyResult) {
        this.pgyResult = pgyResult;
    }

    public int getSystem_version() {
        if (StringUtils.isBlank(system_version)) {
            return 1;
        }
        return StringUtils.getIntToString(system_version.replace(".", ""));
    }
    public String getSystem_version_value() {

        return system_version;
    }


    public void setSystem_version(String system_version) {
        this.system_version = system_version;
    }

    public String getDownload_address() {
        return download_address;
    }

    public void setDownload_address(String download_address) {
        this.download_address = download_address;
    }

    public boolean getIs_forced() {
        return StringUtils.isNotBlank(is_forced) && is_forced.equals("1");
    }

    public void setIs_forced(String is_forced) {
        this.is_forced = is_forced;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public boolean getIs_update() {
        return StringUtils.isNotBlank(is_update) && is_update.equals("1");
    }

    public void setIs_update(String is_update) {
        this.is_update = is_update;
    }
}
